/** 
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package com.tompai.management.user.service;

import java.util.List;

import com.github.pagehelper.PageInfo;
import com.tompai.common.model.SysPermission;
import com.tompai.management.user.web.vo.SysPermissionInfoQueryVo;
import com.tompai.management.user.web.vo.SysPermissionVo;

/**
 * 权限服务层接口
 * 
 * @author liinux@qq.com
 * @date 2019/10/21
 */
public interface SysPermissionService {

	/**
	 * 获取指定id的权限信息
	 * 
	 * @author liinux@qq.com
	 * @date 2019/10/21
	 * @param id
	 * @return
	 */
	SysPermission getSysPermissionInfo(String id);

	/**
	 * 条件查询权限信息
	 * 
	 * @author liinux@qq.com
	 * @date 2019/10/21
	 * @param sysPermission
	 * @return
	 */
	List<SysPermissionVo> selectSysPermissionInfo(SysPermission sysPermission);

	/**
	 * 更新权限信息
	 * 
	 * @author liinux@qq.com
	 * @date 2019/10/21
	 * @param sysPermissionInfoQueryVo
	 */
	void update(SysPermissionInfoQueryVo sysPermissionInfoQueryVo);

	/**
	 * 添加权限信息
	 * 
	 * @author liinux@qq.com
	 * @date 2019/10/21
	 * @param sysPermissionInfoQueryVo
	 */
	void insert(SysPermissionInfoQueryVo sysPermissionInfoQueryVo);

	/**
	 * 删除权限信息
	 * 
	 * @author liinux@qq.com
	 * @date 2019/10/21
	 * @param id
	 */
	void deleteByPrimaryKey(String id);

	/**
	 * 查询菜单信息
	 * 
	 * @author liinux@qq.com
	 * @date 2019/10/23
	 * @return
	 */
	List<SysPermission> getMenus();

	/**
	 * 根据permissionIds查询权限信息
	 * 
	 * @author liinux@qq.com
	 * @date 2019/10/23
	 * @param permissionIds
	 * @return
	 */
	List<SysPermission> selectSysPermission(List<String> permissionIds);

	/**
	 * 根据swagger扫描更新权限列表
	 * 
	 * @author liinux@qq.com
	 * @date 2019/10/29
	 * @return
	 */
	Boolean updatePermissionBySwagger();

	/**
	 * 分页查询角色信息
	 * 
	 * @param sysPermission
	 * @param page
	 * @param limit
	 * @return
	 */
	PageInfo<SysPermission> selectSysPermissions(SysPermission sysPermission, int page, int limit);

	/**
	 * 根据用户id获取对应的权限(资源)
	 * 
	 * @author liinux@qq.com
	 * @date 2019/4/14 1:32
	 * @param userId
	 * @return
	 */
	List<SysPermission> getByUserId(String userId);
}
